using micromsg;
using MicroMsg.Common.Event;
using MicroMsg.Common.Utils;
using MicroMsg.Protocol;
using System;
namespace MicroMsg.Scene
{
	public class NetSceneSendFeedback : NetSceneBaseEx<SendFeedbackRequest, SendFeedbackResponse, SendFeedbackRequest.Builder>
	{
		private const string TAG = "NetSceneSendFeedback";
		public bool doScene(string content)
		{
			base.beginBuilder();
			this.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0);
			this.mBuilder.MachineType = "";
			this.mBuilder.MachineType = this.mBuilder.MachineType + AppInfoHelper.Version;
			this.mBuilder.Content = content;
			this.mSessionPack.mConnectMode = 2;
			this.mSessionPack.mCmdUri = "/cgi-bin/micromsg-bin/sendfeedback";
			base.endBuilder();
			return true;
		}
		protected override void onFailed(SendFeedbackRequest request, SendFeedbackResponse response)
		{
			Log.smethod_1("NetSceneSendFeedback", "send SendFeedbackRequest failed");
			EventCenter.postEvent(EventConst.ON_NETSCENE_FEED_BACK_ERR, null, null);
		}
		protected override void onSuccess(SendFeedbackRequest request, SendFeedbackResponse response)
		{
			RetConst ret = (RetConst)response.BaseResponse.Ret;
			if (ret != RetConst.MM_OK)
			{
				Log.smethod_1("NetSceneSendFeedback", "send SendFeedbackRequest failed ret =" + ret);
				EventCenter.postEvent(EventConst.ON_NETSCENE_FEED_BACK_ERR, null, null);
				return;
			}
			EventCenter.postEvent(EventConst.ON_NETSCENE_FEED_BACK_SUCCESS, null, null);
		}
	}
}
